/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JPanelChercherODS.java
 *
 * Created on 23 mai 2010, 18:20:27
 */

package responsableDeStage;

import com.mysql.jdbc.Connection;
import java.awt.Color;

/**
 *
 * @author Labassi Amine
 */
public class JPanelSuppTut extends javax.swing.JPanel {

    EcranRespDeStage parent ;
    Connection cnt ;
    /** Creates new form JPanelChercherODS */
    public JPanelSuppTut(EcranRespDeStage pParent, Connection pCnt) {
        initComponents();
        parent = pParent ;
        cnt = pCnt ;
        this.setBackground(Color.LIGHT_GRAY);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanelFiltres = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jTextFieldID = new javax.swing.JTextField();
        jButtonID = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jTextFieldNom = new javax.swing.JTextField();
        jButtonNom = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        jTextFieldPrenom = new javax.swing.JTextField();
        jButtonPrenom = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTableEnseign = new javax.swing.JTable();
        jButtonSuppTut = new javax.swing.JButton();
        jButtonAnnuler = new javax.swing.JButton();

        jPanelFiltres.setBorder(javax.swing.BorderFactory.createTitledBorder("Filtres"));

        jLabel1.setFont(new java.awt.Font("Arial", 1, 14));
        jLabel1.setText("ID");

        jButtonID.setText("Filtrer");
        jButtonID.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonIDActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Arial", 1, 14));
        jLabel2.setText("Nom");

        jButtonNom.setText("Filtrer");
        jButtonNom.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonNomActionPerformed(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Arial", 1, 14));
        jLabel3.setText("Prénom");

        jButtonPrenom.setText("Filtrer");
        jButtonPrenom.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonPrenomActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelFiltresLayout = new javax.swing.GroupLayout(jPanelFiltres);
        jPanelFiltres.setLayout(jPanelFiltresLayout);
        jPanelFiltresLayout.setHorizontalGroup(
            jPanelFiltresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelFiltresLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelFiltresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextFieldPrenom, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
                    .addComponent(jTextFieldNom, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
                    .addComponent(jTextFieldID, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
                    .addComponent(jLabel1)
                    .addComponent(jButtonID, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel2)
                    .addComponent(jButtonNom, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3)
                    .addComponent(jButtonPrenom, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        jPanelFiltresLayout.setVerticalGroup(
            jPanelFiltresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelFiltresLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextFieldID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonID)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextFieldNom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonNom)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextFieldPrenom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonPrenom)
                .addContainerGap(149, Short.MAX_VALUE))
        );

        jTableEnseign.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "ID", "Nom", "Prénom", "Tel"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(jTableEnseign);

        jButtonSuppTut.setFont(new java.awt.Font("Arial", 1, 14));
        jButtonSuppTut.setText("Supprimer tuteur");
        jButtonSuppTut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSuppTutActionPerformed(evt);
            }
        });

        jButtonAnnuler.setFont(new java.awt.Font("Arial", 1, 14));
        jButtonAnnuler.setText("Annuler");
        jButtonAnnuler.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAnnulerActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelFiltres, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 660, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(594, Short.MAX_VALUE)
                .addComponent(jButtonAnnuler, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonSuppTut)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
                    .addComponent(jPanelFiltres, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonSuppTut)
                    .addComponent(jButtonAnnuler))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonIDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonIDActionPerformed
       filtrerTableEnseign(1);
       parent.pack();
       parent.setVisible(true);
    }//GEN-LAST:event_jButtonIDActionPerformed

    private void jButtonNomActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNomActionPerformed
        filtrerTableEnseign(2);
        parent.pack();
        parent.setVisible(true);
    }//GEN-LAST:event_jButtonNomActionPerformed

    private void jButtonPrenomActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPrenomActionPerformed
       filtrerTableEnseign(3);
       parent.pack();
       parent.setVisible(true);
    }//GEN-LAST:event_jButtonPrenomActionPerformed

    private void jButtonSuppTutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSuppTutActionPerformed
        
    }//GEN-LAST:event_jButtonSuppTutActionPerformed

    private void jButtonAnnulerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAnnulerActionPerformed
        jPanelVide JPVide = new jPanelVide() ;
        parent.setContentPane( JPVide);
        parent.pack();
        parent.setVisible(true);
    }//GEN-LAST:event_jButtonAnnulerActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonAnnuler;
    private javax.swing.JButton jButtonID;
    private javax.swing.JButton jButtonNom;
    private javax.swing.JButton jButtonPrenom;
    private javax.swing.JButton jButtonSuppTut;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanelFiltres;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTableEnseign;
    private javax.swing.JTextField jTextFieldID;
    private javax.swing.JTextField jTextFieldNom;
    private javax.swing.JTextField jTextFieldPrenom;
    // End of variables declaration//GEN-END:variables

    private void filtrerTableEnseign(int filtre){

        switch (filtre) {
            // ID
            case 1:
            //Sujet
            case 2:
            //Durée
            case 3:

            //default
            default:
                break ;
        }
    }
}
